//server端
#include"comm.h"
#define SIZE 128
PIPE init;
int main()
{
    int fd=open(FIFO,O_RDONLY);
    if(fd<0)perror("open");
    while(true)
    {
        char buffer[SIZE];
       ssize_t n= read(fd,buffer,sizeof(buffer));
       if(n<0){
        perror("read");break;
       }
        else if(n>0)
        {
            buffer[n]='\0';
            std::cout<<buffer<<std::endl;
        }
        else break;
    }
    close(fd);
    return 0;
}